Skip to content

feat: add timeout utility for async operations - #3

Closed
benaiad wants to merge 1 commit into
mainfrom
test/review-dismiss-flow
Closed

feat: add timeout utility for async operations#3
benaiad wants to merge 1 commit into
mainfrom
test/review-dismiss-flow

Conversation

@benaiad

@benaiad benaiad commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Adds a withTimeout wrapper and a duration string parser.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Low-risk PR adding two small utility functions in a new file. withTimeout correctly uses Promise.race with timer cleanup in .finally(), and parseTimeout validates input via regex and converts duration strings to milliseconds. No security, correctness, or error-handling defects found. The only notable points are informational: parseTimeout silently returns a default (30000ms) on invalid input rather than throwing, and TypeScript's type checker assumes the switch is exhaustive without a default — both are minor design choices, not bugs.

@benaiad

benaiad commented Apr 27, 2026

Copy link
Copy Markdown
Owner Author

Test PR — verified reviewer calibration (pre-prompt update). Closing.

@benaiad benaiad closed this Apr 27, 2026
@benaiad
benaiad deleted the test/review-dismiss-flow branch April 27, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant